package pku.ss.news.model;


import java.util.Date;

public class News implements Comparable{
	private String title;
	private String url;
	private String description;
	private Date time;
	private String source;
	public News(String title, String url, String description, Date time, String source) {
		super();
		this.title = title;
		this.url = url;
		this.description = description;
		this.time = time;
		this.source = source;
	}
	public News(){
		super();
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	
	public int compareTo(Object o) {
		if(this.time.after(((News)o).time)){
			return -1;
		}
		else {
			return 1;
		}
	}
}
